const { exec } = require('child_process');

// 执行curl命令
exec('curl -s http://localhost:3000/api/enterprise/policies?page=1&limit=9', (error, stdout, stderr) => {
  if (error) {
    console.error(`执行错误: ${error}`);
    return;
  }
  
  if (stderr) {
    console.error(`stderr: ${stderr}`);
    return;
  }
  
  try {
    // 尝试解析JSON
    const response = JSON.parse(stdout);
    console.log('API响应:');
    console.log(JSON.stringify(response, null, 2));
  } catch (e) {
    console.error('解析响应失败:', e);
    console.log('原始响应:', stdout);
  }
}); 